from database import db


class User(db.Model):
    __tablename__ = 'User'
    id = db.Column(db.INTEGER(), primary_key=True, unique=True)
    openid = db.Column(db.String(100), nullable=True)
    openid2 = db.Column(db.String(100), nullable=True)
    nickName = db.Column(db.String(100), nullable=True)
    realname = db.Column(db.String(100), nullable=True)
    gender = db.Column(db.INTEGER(), nullable=True)
    avatarUrl = db.Column(db.Text, nullable=True)
    phone = db.Column(db.String(11), nullable=True)
    school = db.Column(db.String(100), nullable=True)
    xuehao = db.Column(db.String(100), nullable=True)
    jwpw = db.Column(db.String(100), nullable=True)
    reminder = db.Column(db.INTEGER(), nullable=True)
    money = db.Column(db.FLOAT(), nullable=True)

class Address(db.Model):
    __tablename__ = 'Address'
    id = db.Column(db.INTEGER(), primary_key=True, unique=True)
    userid = db.Column(db.INTEGER(), nullable=False)
    name = db.Column(db.String(100), nullable=False)
    phone = db.Column(db.String(100), nullable=False)
    area = db.Column(db.String(100), nullable=False)
    addr = db.Column(db.String(255), nullable=False)
    addindex = db.Column(db.INTEGER(), nullable=False)

